home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / virus / tbavw622.zip / TBAVWLNG.DOC < prev   
Text File  |  1994-07-11  |  16KB  |  345 lines

  1. Technical information concearning the TBAVWIN language file.
  2. ============================================================
  3.  
  4. 1. Introduction.
  5.  
  6. This document comprises technical information about the language file used by
  7. the ThunderBYTE for Windows products. 
  8.  
  9. THIS DOCUMENT IS NOT INTENDED FOR NOVICE USERS ! 
  10.  
  11. The language file may be viewed as an online resource description file, and 
  12. contains the definition and specification of menus, dialogs, global
  13. items and more. Thus, if you need to change the TBAVWIN menu, or one of
  14. the dialogs, just change the appropriate block in the language file.
  15.  
  16. This design of the language file brings very usefull properties along. Suppose
  17. you're a system administrator and you have installed TBAVWIN, with those
  18. options selected for the ThunderBYTE utilities that you think are important.
  19. However, since the standard TBAVWIN menu comprises an item 'Quit TBAVWIN and
  20. save', users can change the option settings, and save their own configuration.
  21. With the language file, it is possible to completely remove the menu item 'Quit
  22. TBAVWIN and save', so that users cannot save their settings anymore.
  23.  
  24. The language file is made up by a combination of resource blocks (called 
  25. Global, Menu and Dialog). We will continue this document by first 
  26. describing the general layout of the language file, and then describing the 
  27. purpose of the resource blocks.
  28.  
  29.  
  30. 2. General layout of the language file
  31.  
  32. The language file is a simple text-only file. It may contain comment-lines, 
  33. which begin with a semicolon (';'). Newlines or spaces can be inserted anywhere
  34. within the file. All non-trivial lines (lines that are not empty and do not
  35. contain comment) are made up of a statement and zero or more parameters, in a
  36. fixed order. The statement definitions are case insensitive. The parameters 
  37. are enclosed within hooked brackets ('<' and '>') and can denote both a string 
  38. of characters or a number, depending on the statement and the parameter itself.
  39. A number can be specified in decimal notation, or in hexadecimal notation. If
  40. the latter is used, the number should be preceeded by '0x' or '0X'. If a 
  41. parameter is used to specify a string of characters, this parameter will 
  42. always be the last parameter in the list of parameters.
  43.  
  44. Let's examine the following excerpt of the language file:
  45.  
  46.    ; 
  47.    ; This is the ThunderBYTE Anti-Virus / Windows language file.
  48.    ;
  49.    ; UNLESS YOU ARE AN EXPERIENCED USER, DO NOT ALTER THE NON-TEXT BLOCKS !!!
  50.    ;
  51.    GlobalBegin
  52.       Title        <ThunderBYTE Anti-Virus Utilities for Windows>
  53.       String<55>   <Error reading signature file>
  54.       String<0x38> <Error while allocating memory>
  55.    GlobalEnd
  56.    ;
  57.    ; The end...
  58.  
  59. In this excerpt, we see seven comment lines (the lines that begin with a
  60. semicolon). Furthermore, one resource block is defined; the start is defined 
  61. by the line containing the statement 'GlobalBegin'. The block ends with the
  62. line 'GlobalEnd'. Thus, this block defines the global resource block. The
  63. block contains three statements, namely 'Title' and 'String'; the latter 
  64. statement appears twice. The first is used to specify the title of the program, 
  65. whilst the 'String' statement defines a global string resource. The Title 
  66. statement (which is also discussed later on in this file) has only one 
  67. parameter, which is a string of characters. As you can see, you can insert 
  68. spaces between the statement itself and its parameters. The String statement 
  69. has two parameters: a string identifier (in case of the first 'String' 
  70. specification the number 55, in case of the second this identifier is the 
  71. hexadecimal number 0x38 (56 in decimal representation)) and the string 
  72. specification. The String statement is described in more detail in the next 
  73. chapter.
  74.  
  75. THE STRING IDENTIFIER IS AN INTERNAL IDENTIFIER FOR THE TBAVWIN PROGRAM, 
  76. SO YOU SHOULD NOT ALTER THIS IDENTIFIER !
  77.  
  78.  
  79. 3. The Global resource block
  80.  
  81. The global resource block is defined by two lines: 'GlobalBegin', which
  82. appears in the beginning of the block, and 'GlobalEnd' at the end of
  83. the block. Within the Global block, you can use eleven statements, which
  84. will be discussed in the sequel.
  85.  
  86.  
  87. 3.1 The Title statement
  88.  
  89. The 'Title' statement is used to specify the title of the TBAVWIN program.
  90. It has only one parameter, with which the title text is defined.
  91.  
  92.  
  93. 3.2 The String statement
  94.  
  95. Within the TBAVWIN program, several global string resources are used. For
  96. example, the text in the buttons of a dialog is a global string resource.
  97. The 'String' statement needs two parameters: an identifier (the first 
  98. parameter) and a text-string (the second parameter). 
  99.  
  100. THE STRING IDENTIFIER IS AN INTERNAL IDENTIFIER FOR THE TBAVWIN PROGRAM, 
  101. SO YOU SHOULD NOT ALTER THIS IDENTIFIER !
  102.  
  103. Here's a list of the most commonly used identifiers:
  104.  
  105.    identifier | used in
  106.    -----------+----------------------------------
  107.        1      | the 'OK' button in a dialog
  108.        2      | the 'Cancel' button in a dialog
  109.        3      | the 'Abort' button in a dialog
  110.        4      | the 'Retry' button in a dialog
  111.        5      | the 'Ignore' button in a dialog
  112.        6      | the 'Yes' button in a dialog
  113.        7      | the 'No' button in a dialog
  114.       998     | the 'Help' button in a dialog
  115.  
  116. These identifiers are also used as a cross-reference in the dialog definitions
  117. (refer to chapter 6, the chapter about the Dialog resource block)
  118.  
  119. In the second parameter of the 'String' statement, which defines the 
  120. text-string, you may insert two '~' characters to specify a newline. Thus, a
  121. line like
  122.  
  123.    String<15><First line~~Second line>
  124.  
  125. will appear on the screen as:
  126.  
  127.    First line
  128.    Second line
  129.  
  130.  
  131. 3.3 The ColorDlgBg statement
  132.  
  133. With this 'ColorDlgBg' statement, you can specify the background color of
  134. the dialogs used by the TBAVWIN program. Colors are specified using three
  135. parameters, which respectively represent the intensity of the Red, Blue 
  136. and Green color components. This intensity can be any number from 0 up to
  137. 255, with 0 representing no intensity and 255 representing full intensity. 
  138. For example, if you want the dialog background to be bright red, you should 
  139. specify
  140.  
  141.    ColorDlgBg<255><0><0>
  142.  
  143. If you want the background to be dark grey, you should specify
  144.  
  145.    ColorDlgBg<128><128><128>
  146.  
  147.  
  148. 3.4 The ColorButton statement
  149.  
  150. The 'ColorButton' statement is used to specify the color of the buttons
  151. in the dialogs used by the TBAVWIN program. Colors are specified using three
  152. parameters, which respectively represent the intensity of the Red, Blue 
  153. and Green color components. This intensity can be any number from 0 up to
  154. 255, with 0 representing no intensity and 255 representing full intensity. 
  155. For an example, refer to section 3.3.
  156.  
  157.  
  158. 3.5 The ColorEdit statement
  159.  
  160. The 'ColorEdit' statement is used to specify the background color of edit 
  161. controls in the dialogs used by the TBAVWIN program. The foreground color
  162. in an edit control can be specified using the 'ColorText' statement (section
  163. 3.10). Colors are specified using three parameters, which respectively 
  164. represent the intensity of the Red, Blue and Green color components. This 
  165. intensity can be any number from 0 up to 255, with 0 representing no 
  166. intensity and 255 representing full intensity. For an example, refer 
  167. to section 3.3.
  168.  
  169.  
  170. 3.6 The ColorListBox statement
  171.  
  172. The 'ColorListBox' statement is used to specify the color of list boxes
  173. in the dialogs used by the TBAVWIN program. Colors are specified using three
  174. parameters, which respectively represent the intensity of the Red, Blue 
  175. and Green color components. This intensity can be any number from 0 up to
  176. 255, with 0 representing no intensity and 255 representing full intensity. 
  177. For an example, refer to section 3.3.
  178.  
  179.  
  180. 3.7 The ColorScrBar statement
  181.  
  182. The 'ColorScrBar' statement is used to specify the color of the scroll bar
  183. in the dialogs used by the TBAVWIN program. Colors are specified using three
  184. parameters, which respectively represent the intensity of the Red, Blue 
  185. and Green color components. This intensity can be any number from 0 up to
  186. 255, with 0 representing no intensity and 255 representing full intensity. 
  187. For an example, refer to section 3.3.
  188.  
  189.  
  190. 3.8 The ColorStatic statement
  191.  
  192. The 'ColorStatic' statement is used to specify the color of static text
  193. in the dialogs used by the TBAVWIN program. Colors are specified using three
  194. parameters, which respectively represent the intensity of the Red, Blue 
  195. and Green color components. This intensity can be any number from 0 up to
  196. 255, with 0 representing no intensity and 255 representing full intensity. 
  197. For an example, refer to section 3.3.
  198.  
  199.  
  200. 3.9 The ColorText statement
  201.  
  202. The 'ColorButton' statement is used to specify the foreground color of text
  203. in edit controls in the dialogs used by the TBAVWIN program. Colors are 
  204. specified using three parameters, which respectively represent the 
  205. intensity of the Red, Blue and Green color components. This intensity can 
  206. be any number from 0 up to 255, with 0 representing no intensity and 255 
  207. representing full intensity. For an example, refer to section 3.3.
  208.  
  209.  
  210. 4. The Menu resource block
  211.  
  212. The TBAVWIN menu is defined by the 'Menu' resource block. Such a block 
  213. starts with a line containing 'MenuBegin', and ends with a line containing
  214. 'MenuEnd'. Each menu is identified by a name, which is a parameter of the
  215. line containing 'MenuBegin'. In the TBAVWIN program, only one menu is used
  216. which is called 'MainMenu'. The Menu resource block is comprised by 
  217. 'MenuPopup' blocks and 'MenuItem' statements, which will be discussed 
  218. in the sequel.
  219.  
  220.  
  221. 4.1 The MenuPopUp block
  222.  
  223. A popup menu can be specified using the MenuPopup block. Such a block starts
  224. with a line containing 'MenuPopupStart' and ends with a line containing 
  225. 'MenuPopupEnd'. With MS-Windows 3.1, it is possible to access popup menus
  226. using the keyboard. To do so, you need to press the 'ALT' key and a key which
  227. represents the popup menu simultaneoulsy. You can specify the key that
  228. represents the popup menu in the menu name, by inserting a '&'-character before 
  229. the character that represents the key. The menu name is a paramater to the
  230. line containing 'MenuPopupStart'. For example, suppose you have the following
  231.  
  232.    MenuPopUpStart    <&File>
  233.       MenuItem<100>  <&Configure TBAVWIN...>
  234.       MenuSeparator
  235.       MenuItem<101>  <&Quit and save>
  236.       MenuItem<102>  <E&xit TBAVWIN>
  237.    MenuPopUpEnd
  238.  
  239. In this example, the name of the popup menu is 'File'. Since the character 'F'
  240. in this name is preceeded by a '&' character, you can access the popup menu
  241. by pressing the 'ALT' and 'F' key simultaneously.
  242.  
  243. A MenuPopUp block can contain other MenuPopUp blocks, and MenuItem and 
  244. MenuSeparator statements. A MenuSeparator causes a horizontal bar to appear
  245. in the menu. This is illustrated by the previous example, which creates a menu
  246. that looks like:
  247.  
  248.    + File ------------------+
  249.    |  Configure TBAVWIN...  |
  250.    | ---------------------- |
  251.    |  Quit and save         |
  252.    |  Exit (no save)        |
  253.    +------------------------+
  254.  
  255. The meaning of the MenuItem statement is described in the next section.
  256.  
  257.  
  258. 4.2 The MenuItem statement
  259.  
  260. Each menu item is comprised by a number and some character string. The number
  261. is an identifier used internally by the TBAVWIN program and is specified by
  262. the first parameter of the 'MenuItem' statement. The character string is
  263. specified using the second parameter of the statement. In such a character 
  264. string you can again use the '&' character to identify a key with which you
  265. can select the item using the keyboard. To explain this, we use the example
  266. of section 5.1. If you have selected the menu (using the mouse, or by pressing
  267. ALT+F on your keyboard, you can select the 'Quit and save' item, for example,
  268. by pressing the 'Q' key on your keyboard, since the 'Q' character is preceeded
  269. by a '&' character in the MenuItem statement.
  270.  
  271.  
  272. 5. The Dialog resource block
  273.  
  274. The last in the list of blocks is the Dialog resource block. Such a block
  275. start with a line containing 'DialogBegin' and ends with a line containing
  276. 'DialogEnd'. The line containing 'DialogBegin' should have two parameters:
  277. the first representing the dialog identifier used internally by the TBAVWIN 
  278. program, and the second representing the dialog title. The title parameter
  279. can be an empty parameter (an opening bracket followed directly by a closing 
  280. bracket). Each Dialog resource block should contain a 'DialogStyle' statement,
  281. a 'DialogSize' statements and one or more 'DialogControl' statements. These
  282. statements will be discussed in further detail in the following sections.
  283.  
  284.  
  285. 5.1 The DialogStyle statement
  286.  
  287. Each dialog used with MS-Windows should have a certain style, which is
  288. really a sequence of bits, each representing a sub-style. The 'DialogStyle'
  289. statement is used to specify such styles. It has only one parameter,
  290. representing a 32-bit word. THE DIALOG STYLE SHOULD NOT BE ALTERED.
  291.  
  292.  
  293. 5.2 The DialogSize statement
  294.  
  295. The 'DialogSize' statement defines the top-left position of the dialog,
  296. and the width and height of the dialog. The first parameter of the statement
  297. represents the horizontal co-ordinat of the top-left corner of the dialog;
  298. the vertical co-ordinat is specified by the second parameter. The third
  299. and fourth parameter respectively define the width and height of the 
  300. dialog. All four parameters use a single pixel as a unit.
  301.  
  302.  
  303. 5.3 The DialogControl statement
  304.  
  305. The 'DialogControl' statement is a very complex statement which can be used
  306. to define buttons, list boxes, edit controls, static text, icons and more.
  307. It should have seven or eight parameters. The first four parameters 
  308. respectively represent the horizontal co-ordinat of the top-left corner of the
  309. control, the vertical co-ordinat of the top-left corner of the control, and
  310. the width and height of the control. The fifth parameter represents the
  311. control identifier and is used internally in the TBAVWIN program. The sixth
  312. parameter is used to define the control style. THE CONTROL STYLE SHOULD NOT
  313. BE ALTERED. The seventh parameter is used to define the kind of control:
  314.  
  315.    Control Type  | Kind of control
  316.    (Hexadecimal) |
  317.    --------------+---------------------------------------------------
  318.         0x80     | Button (pushbutton, radiobutton, checkmark, ....)
  319.         0x81     | Edit control
  320.         0x82     | Static (text, icon, ....)
  321.         0x83     | List box
  322.         0x84     | Scroll bar
  323.         0x85     | Combo box
  324.         
  325. If the control type equals 0x80 (button control), and the control identifier
  326. (defined in parameter 5) equals one of the identifiers listed in the table of
  327. section 3.2, no more parameters are needed. The TBAVWIN program automatically
  328. searches the list of global string resources and links the string which has
  329. the same identifier as the control, with the control. Thus, if you specify
  330. a control like
  331.  
  332.    DialogControl<60><100><32><20><1><0x50010000><0x80>
  333.  
  334. then TBAVWIN recognizes that this statement defines an 'OK' button, since
  335. the control type equals 0x80, and the identifier equals 1. The string which
  336. is assigned to the control is then copied from that string of the list of 
  337. global string resources, that has an identifier equal to 1.
  338.  
  339. In any other case, a character string must be specified in the eight 
  340. parameter. The string may be empty (an opening bracket may be followed directly 
  341. by a closing bracket). In such a character string you can use the '&' 
  342. character to identify a key with which you can select the item using 
  343. the keyboard. Refer to chapter 4 for an explanation on this topic.
  344.  
  345.